/* Firmware update functions, public interface */

/* Copyright (C) 2012 David Zanetti
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; version 2 of the License.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License along
 *  with this program; if not, write to the Free Software Foundation, Inc.,
 *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

#define FW_UPDATE_H

/* initalise the installation process, providing the CRC we should expect (malloc()s a buffer!) */
void fw_new(uint16_t crc);

/* send us some data, we maintain an SPM_PAGESIZE buffer for this so just feed us as you go */
uint8_t fw_temp_write(uint8_t *data, uint16_t size);
/* same, using outstanding packet data */
uint8_t fw_temp_write_ethernet(uint16_t size);

/* perform the installation, this will not be returned from */
void fw_install(void);

/* discard the new FW, and free us the SPM_PAGESIZE buffer */
void fw_discard(void);
